import { Controller, Type } from "@nestjs/common/interfaces";

const Modules:ModulesProp[] = []

export default {
  // 全量Controllers
  Controllers:Modules.map(({ controller }) => controller),
  // 全量Services
  Services:Modules.map(({ service }) => service),
  // Api模块所用到的Controller
  ApiControllers:Modules.filter(({ modules }) => modules.includes("api")).map(({ controller }) => controller),
  // Api模块所用到的Services
  ApiServices:Modules.filter(({ modules }) => modules.includes("api")).map(({ service }) => service),
}

export interface ModulesProp {
  // 所属模块 api(api模块)
  modules:"api" | string;
  controller:Controller,
  service:Type
}